var baseUrl = 'http://47.108.197.28:3000'
function http(url){
  return new Promise((resolve,reject)=>{
    wx.request({
      url:baseUrl+url,
      method:"GET",
      dataType:"json",
      responseType:"text",
      success:(res)=>{
        resolve(res)
      },
      error:(err)=>{
        reject(err)
      }
    })
  })
}
function getMvHttp(){
  return http(`/mv/first`)
}
function getMvDetailHttp(id){
  return http(`/mv/url?id=${id}`)
}
function getMvMusicHttp(keyword){

  return http(`/search?keywords=${keyword}`)
}

module.exports={
  getMvHttp,
  getMvDetailHttp,
  getMvMusicHttp
}